import Vue from 'vue'

import App from './App'
import router from './router'
import store from './store'
import mixins from './mixins'
import ElementUI from 'element-ui'
import HTTP from './utils/http'
import API from './api'
import 'element-ui/lib/theme-chalk/index.css'

// 全局注册UI
Vue.use(ElementUI)
// 全局注册混合
Vue.mixin(mixins)

if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
Vue.bus = Vue.prototype.$bus = new Vue()
Vue.config.productionTip = false
Vue.prototype.http = HTTP
Vue.prototype.api = API

// import { app, globalShortcut} from 'electron'
// app.on('ready', () => {
//   const ret = globalShortcut.register('CommandOrControl+X', () => {
//     this.bus.$emit('CtrlX')
//   })
//   if (!ret) {
//     console.log('registration failed ')
//   }
// })

// app.on('will-quit', () => {
//   // 注销快捷键
//   globalShortcut.unregister('我是自定义快捷的')
//   // 清空所有快捷键
//   globalShortcut.unregisterAll()
// })


/* eslint-disable no-new */
new Vue({
  components: { App },
  router,
  store,
  template: '<App/>'
}).$mount('#app')
